//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        //TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
        // to see how IntelliJ IDEA suggests fixing it.
        //饿汉单例
        EagerSingletonFactory.getInstance().setMyName("张三");
        System.out.println(EagerSingletonFactory.getInstance().shoInfo());

        System.out.println(EagerSingletonFactory.getInstance().getMyName());

        System.out.println(EagerSingletonFactory.getInstance().shoInfo());

        //懒汉单例
        System.out.println(LazySingletonFactory.getInstance().shoInfo());
        System.out.println(LazySingletonFactory.getInstance().shoInfo());


    }
}